package android.scanner.scan.module;

import android.os.Bundle;
import android.scanner.scan.R;
import android.support.v7.app.ActionBarActivity;
import android.view.MenuItem;
import android.widget.TextView;

/**
 * Created by lori.lin
 * on 15/1/21 下午3:03
 * usage:
 */
public class ResultActivity extends ActionBarActivity {

    TextView mTvResult;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_result);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        initViews();
        String show  = getIntent().getStringExtra("show");
        if (show!=null)
        {
            if ("s".equals(show))
            {
                mTvResult.setText("扫描成功");
            }
            else if ("f".equals(show))
            {
                mTvResult.setText("无此人信息");
            }
        }

    }

    public void initViews()
    {
        mTvResult = (TextView)this.findViewById(R.id.tv_result);

    }
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        if (id == android.R.id.home) {
            ResultActivity.this.finish();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}
